package cn.fenqing168.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author Administrator
 */
@RestController
@Slf4j
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    private final static String PAYMENT_SERVER_BASE_URL = "http://cloudalibaba-provider-payment";

    @GetMapping("/consumer/payment/nacos")
    public String payment(){
        return restTemplate.getForObject(PAYMENT_SERVER_BASE_URL + "/payment/nacos", String.class);
    }

}
